﻿using System;
using System.Data;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.SqlClient;

namespace ASPNETVN.PORTAL.Modules.ADVERTISEMENT.Components
{
    public partial class Item
    {
        public static DataSet SelectTop(Guid ModuleID, int top)
        {
            const string spName = "[dbo].[p_ADVERTISEMENT_Item_SelectTop]";
            SqlDatabase db = (SqlDatabase)DatabaseFactory.CreateDatabase();
            SqlCommand dbCommand = (SqlCommand)db.GetStoredProcCommand(spName);
            db.AddInParameter(dbCommand, "@ModuleID", SqlDbType.UniqueIdentifier, ModuleID);
            db.AddInParameter(dbCommand, "@Top", SqlDbType.Int, top);

            return db.ExecuteDataSet(dbCommand);
        }
    }
}
